package com.eregg.spring.cloud.movie.feign;

import com.eregg.spring.cloud.movie.bean.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 使用 FeignClient 替代restClient 请求微服务-提供者
 * Created by e on 2017/11/9
 *
 * @author <a href="http://eregg.com">eregg</a>
 */
@FeignClient(name = "microservice-provider-user", fallbackFactory = FeignClientFallbackFactory.class)
public interface UserFeignClient {

    @RequestMapping(value = "{id}", method = RequestMethod.GET)
    public User findById(@PathVariable("id") Long id);
}
